--- wine-2.21/dlls/opengl32/wgl.c.org	2017-11-28 17:52:06.100882751 +0100
+++ wine-2.21/dlls/opengl32/wgl.c	2017-11-28 17:52:51.621079107 +0100
@@ -253,6 +253,31 @@
     return ret;
 }
 
+static
+const int* remove_profile_mask(const int *attribs)
+{
+    int* ret = NULL;
+    int i = 0;
+    int j = 0;
+    int attr_num = 0;
+    int profile_mask = 0;
+    for (i = 0; attribs[i] != NULL; i += 2) {
+        if (attribs[i] == WGL_CONTEXT_PROFILE_MASK_ARB)
+            profile_mask = 1;
+        ++attr_num;
+    }
+    if (profile_mask == 0) return attribs;
+    ret = calloc(attr_num*2 - 1, sizeof(int));
+    for (i = 0; attribs[i] != NULL; i += 2) {
+        if (attribs[i] != WGL_CONTEXT_PROFILE_MASK_ARB) {
+            ret[j] = attribs[i];
+            ret[j+1] = attribs[i+1];
+            j += 2;
+        }
+    }
+    return ret;
+}
+
 /***********************************************************************
  *		wglCreateContextAttribsARB
  *
@@ -265,6 +290,7 @@
     struct wgl_handle *share_ptr = NULL;
     struct opengl_context *context;
     struct opengl_funcs *funcs = get_dc_funcs( hdc );
+    attribs = remove_profile_mask(attribs);
 
     if (!funcs)
     {
